package com.axend.aerosense.home.adapter;

/*
@author MM.Li
@date 2021/3/16-10:16
*/

import android.util.Log;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.axend.aerosense.common.bean.EarlyWarningBean;
import com.axend.aerosense.home.R;
import com.axend.aerosense.home.databinding.HomeWarningRecylceCellBinding;

import org.jetbrains.annotations.NotNull;


public class ReportAdapter extends BaseQuickAdapter<EarlyWarningBean, BaseDataBindingHolder<HomeWarningRecylceCellBinding>> {


    public ReportAdapter() {
        super(R.layout.home_warning_recylce_cell);
    }


    @Override
    protected void convert(@NotNull BaseDataBindingHolder<HomeWarningRecylceCellBinding> holder, EarlyWarningBean bean) {

        HomeWarningRecylceCellBinding binding = holder.getDataBinding();
        if (null == bean || null == binding) {
            return;
        }
        binding.setData(bean);
        binding.executePendingBindings();

        String title = bean.getEarlyWarningTypeName();
//        if (bean.getEarlyWarningTipType() == EarlyWarningBean.remind_type) {
//            title += holder.itemView.getContext().getString(R.string.common_remind);
//        } else {
//            title += holder.itemView.getContext().getString(R.string.common_warn);
//        }

        binding.homeWarningType.setText(title);
    }
}
